using UwinEducation.Domain.Entities;
using UwinEducation.Shared.Models;

namespace UwinEducation.Domain.IRepositories
{
    /// <summary>
    /// 教师课表仓储接口
    /// </summary>
    public interface ITeacherScheduleRepository : IRepository<TeacherSchedule, Guid>
    {
        /// <summary>
        /// 获取教师课表分页列表
        /// </summary>
        Task<PagedResult<TeacherSchedule>> GetPagedListAsync(TeacherSchedulePageRequest pageRequest);

        /// <summary>
        /// 获取教师课表统计分页列表
        /// </summary>
        Task<PagedResult<TeacherSchedule>> GetStatisticsPagedListAsync(TeacherScheduleStatisticsPageRequest pageRequest);


        /// <summary>
        /// 获取教师的课表列表
        /// </summary>
        Task<List<TeacherSchedule>> GetByTeacherIdAsync(Guid teacherId);

        /// <summary>
        /// 获取课程的课表列表
        /// </summary>
        Task<List<TeacherSchedule>> GetByCourseIdAsync(Guid courseId);
        /// <summary>
        /// 获取Groups的课表列表
        /// </summary>
        /// <param name="groupIds"></param>
        /// <returns></returns>
        Task<List<TeacherSchedule>> GetByGroupIdsAsync(List<Guid> groupIds);

        /// <summary>
        /// 获取Group的课表列表
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        Task<List<TeacherSchedule>> GetByGroupIdAsync(Guid groupId);

        /// <summary>
        /// 检查时间段是否冲突
        /// </summary>
        Task<bool> HasTimeConflictAsync(Guid teacherId, DateTime startTime, DateTime endTime, Guid? excludeId = null);
        /// <summary>
        /// 获取教室的课表列表
        /// </summary>
        /// <param name="classroomId"></param>
        /// <param name="startTime"></param>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        Task<List<TeacherSchedule>> GetByClassroomIdAsync(Guid? classroomId, DateTime startTime, DateTime dateTime);

        /// <summary>
        /// 获取指定日期范围内教师的所有课表
        /// </summary>
        /// <param name="teacherId">教师ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>教师课表列表</returns>
        Task<List<TeacherSchedule>> GetByTeacherIdInDateRangeAsync(Guid teacherId, DateTime startDate, DateTime endDate);
    }
}